﻿namespace Microsoft.Extensions;

public static class CommonExtensions
{
    public static bool IsNullOrEmpty(this string str)
    {
        return string.IsNullOrEmpty(str);
    }
    public static bool IsNullOrWhiteSpace(this string str)
    {
        return string.IsNullOrWhiteSpace(str);
    }

    /// <summary>
    /// 列表不为null且满足Any()
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="ls"></param>
    /// <returns></returns>
    public static bool IsAny<T>(this List<T> ls)
    {
        return ls != null && ls.Any();
    }
}
